import 'package:flutter/material.dart';

import 'web/web_viewer.dart';
import 'model_viewer.dart';
import 'unity_viewer.dart';
import 'three_viewer.dart';

// Three.dart
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // showPerformanceOverlay: true,
      title: 'Flutter 3D Sample Code',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(backgroundColor: Theme
            .of(context)
            .colorScheme
            .inversePrimary, title: const Text("Flutter 3D Sample Code"),
        ),
        body: Center(
          child: Column(
            children: [
              ElevatedButton(
                  onPressed: () {
                    Navigator.push(context, MaterialPageRoute(
                        builder: (context) => const WebViewer()));
                  },
                  child: const Text("webview_flutter")
              ),
              ElevatedButton(
                  onPressed: () {
                    Navigator.push(context, MaterialPageRoute(
                        builder: (context) => const Model3DViewer()));
                  },
                  child: const Text("model_viewer_plus")
              ),
              // ElevatedButton(
              //     onPressed: () {
              //       Navigator.push(context, MaterialPageRoute(
              //           builder: (context) => const ThreeViewer()));
              //     },
              //     child: const Text("three_dart")
              // ),
              ElevatedButton(
                  onPressed: () {
                    Navigator.push(context, MaterialPageRoute(
                        builder: (context) => const UnityViewer()));
                  },
                  child: const Text("flutter_unity_widget")
              ),
            ],
          ),
        )
    );
  }
}

